
import Request from '@/utils/requset.js'
let request = new Request().http

function removeStr(obj) {
  if(obj) {
    let removePropertyOfNull=function(obj){
      Object.keys(obj).forEach(item=>{
        if(!obj[item])  delete obj[item]
      })
      return obj;
    }
    removePropertyOfNull(obj)
  }
  return obj?obj:''
}

// 我提交的问题列表
const getQueryMyQuestion = (params) => {
	return request({
	    url: "/nailCustomerService/queryMyQuestion",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 查看某个客服详情
const getQueryMyQuestionDetail = (params) => {
	return request({
	    url: "/nailCustomerService/queryMyQuestionDetail",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 客服管理-添加
const addQuestion = (params) => {
	return request({
	    url: "/nailCustomerService/add",
	    method: "POST",
	    data: removeStr(params),
	})
}

export{
	getQueryMyQuestion,
	addQuestion,
	getQueryMyQuestionDetail
}